<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- 容器 -->
  <div></div>

  <script src="../../assets/libs/art-template/template-web.js"></script>

  <!-- 模板 -->
  <script id="my-template" type="text/html">
    <p>姓名：{{ name }}</p>
    <p>年龄：{{ age }}</p>
  </script>

  <script>
    // 数据
    const data = {
      name: '张智琦',
      age: 18
    }

    // 模板 + 数据 = HTML
    const htmlStr = template('my-template', data)

    document.querySelector('div').innerHTML = htmlStr
  </script>
</body>

</html>